package com.example.demo.config.aspect;

import com.example.demo.annotation.AspectTest;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Slf4j
public class AnnotationAspect {

    public static final String NUMBER = "1";

    @Before("@annotation(testAspect)")
    public void before(JoinPoint joinPoint, AspectTest testAspect) {
        if (NUMBER.equals(testAspect.val1())) {
            log.info("测试注解切面-before");
        }
    }
}
